﻿<%@ Page Title="Phân quyền nhóm người dùng" Language="C#" MasterPageFile="~/App_MasterPages/Aquarius.Master" AutoEventWireup="true" CodeBehind="SysAssignRightsGroupPage.aspx.cs" Inherits="Anuntiomatic.Server.SysAssignRightsGroupPage" %>

<asp:Content ID="Content2" ContentPlaceHolderID="ScriptContent" runat="server">
    <script type="text/javascript">
        $(document).ready(function () {
            $(":checkbox").click(function () {
                SetRight($(this));
            });
        });
        function SetRight(checkbox) {
            var arr = $(checkbox).val().split("|");
            var checked = $(checkbox).prop("checked");
            var groupId = arr[0], menuId = arr[1], roleCode = arr[2];
            $.ajax({
                type: "POST",
                url: 'SysAssignRightsGroupPage.aspx/SetRight',
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                beforeSend: function () {
                    $("#progress").show();
                },
                complete: function () {
                    $("#progress").hide();
                },
                data: "{'groupId':" + JSON.stringify(groupId) + ", 'menuId':" + JSON.stringify(menuId) + ", 'roleCode':" + JSON.stringify(roleCode) + ", 'check':" + JSON.stringify(checked) + "}",
                error: function () {
                    $(checkbox).prop("checked", !checked);
                },
                async: false
            });
        }
    </script>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="MainContent" runat="server">
    <asp:DropDownList ID="ddlSysGroup" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlSysGroup_SelectedIndexChanged"></asp:DropDownList>
    <div class="head">
        <div class="isw-grid"></div>
        <h1>Phân quyền trên các trang</h1>
        <div class="clear"></div>
    </div>
    <div class="block-fluid table-sorting">
        <asp:GridView ID="grvRights" CssClass="dataTables_wrapper table2 dataTable" 
            runat="server" EnableViewState="false"
            AutoGenerateColumns="true" ShowHeaderWhenEmpty="true" 
            onrowcreated="grvRights_RowCreated">
        </asp:GridView>
    </div>
    <div class="ui-widget-overlay ui-front" id="progress" style="display:none">
        <img src='<%=ResolveUrl("~/images/loading.gif")%>' alt="Loading..." style="position: fixed; top: 50%; left: 50%" />
    </div>
</asp:Content>
